package com.syxp.pda.core.service.impl;

import java.io.Serializable;

import org.springframework.transaction.annotation.Transactional;

import com.syxp.pda.core.dao.BaseDao;
import com.syxp.pda.core.service.GenericService;

public class GenericServiceImpl<T,PK extends Serializable> implements GenericService<T,Integer>{

	private BaseDao<T> baseDao ;
	
	public GenericServiceImpl(BaseDao<T> baseDao){
		this.baseDao = baseDao ;
	}
	@Override
	public T addService(T param) {
		// TODO Auto-generated method stub
		return baseDao.save(param) ;
	}

	@Override
	public void removeService(Integer paramPK) {
		// TODO Auto-generated method stub
		baseDao.remove(paramPK) ;
	}

	@Override
	public T updateService(T param) {
		// TODO Auto-generated method stub
		return baseDao.update(param) ;
	}

	@Override
	public T loadService(Integer paramPK) {
		// TODO Auto-generated method stub
		return baseDao.get(paramPK) ;
	}
	@Override
	public BaseDao<T> getDao() {
		// TODO Auto-generated method stub
		return baseDao;
	}


}
